qui(
    function (require, exports, module) {
        Program.Dao = $.extend({}, EpgWeb.Dao, {

            // 节目添加
            setProgramAddData: function (data, callback) {
                var options = {
                    url: EpgWeb.urlConfig.programAdd,
                    dataType: 'json',
                    data: data,
                    method: 'post',
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                };
                Ancestor.Dao.ajax(options, '/program/add');
            },
            // 节目修改
            setProgramModifyData: function (data, callback) {
                var options = {
                    url: EpgWeb.urlConfig.programEdit,
                    dataType: 'json',
                    data: data,
                    method: 'post',
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                };

                Ancestor.Dao.ajax(options, '/program/edit');
            },
            // 节目删除
            deleteProgramData: function (data, callback) {
                var options = {
                    url: EpgWeb.urlConfig.programDel,
                    dataType: 'json',
                    data: data,
                    method: 'post',
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                };

                Ancestor.Dao.ajax(options, '/program/delete');
            },
            // 紧急检查
            forceCheckProgram: function (data, callback) {
                var options = {
                    url: EpgWeb.urlConfig.programForceCheck,
                    dataType: 'json',
                    data: data,
                    method: 'get',
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                };
                Ancestor.Dao.ajax(options, '/program/forceCheck');
            },
            // 获取节目数据列表
            getProgramListByDay: function (data, callback) {
                var options = {
                    url: EpgWeb.urlConfig.programList,
                    dataType: 'json',
                    data: data,
                    method: 'post',
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                };
                Ancestor.Dao.ajax(options, '/program/list');
            },

            //检查 导播台
            createDirector:function(data, callback){
                var options = {
                    url: EpgWeb.urlConfig.directorCreateUrl,
                    dataType: 'json',
                    data: data,
                    method: 'post',
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                };
                Ancestor.Dao.ajax(options, '/director/create');
            },

            //同步tvmao 节目 start
            syncTVmaoPrograms: function (data, callback) {
                var options = {
                    url: EpgWeb.urlConfig.programSyncUrl,
                    dataType: 'json',
                    data: data,
                    method: 'post',
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                };
                Ancestor.Dao.ajax(options, "/program/syncTVMao");
            },
            //同步tvmao 节目 end

            liveChannelType: function () {
                return this.getDataByName(this.cfgName.liveChannelType)
            },

            liveProgramType: function () {
                return this.getDataByName(this.cfgName.liveProgramType);
            },

            liveType: function () {
                return this.getDataByName(this.cfgName.LiveType);
            },

            episodeGradeType: function () {
                return this.getDataByName(this.cfgName.episodeGradeType);
            },
            logType: function () {
                return this.getDataByName(this.cfgName.LogType);
            },
            recommendRateType:function(){
                return this.getDataByName(this.cfgName.recommendRateType);
            },
            getChannel: function () {
                return this.getDataByName(this.cfgName.getChannel).data;
            },
            targetName: function () {
                return  this.getDataByName(this.cfgName.targetName);
            },
            getProgram: function () {
                var responseData = this.targetName();
                if (responseData == null || responseData.data == null || responseData.data.totalCount == 0) {
                    return null;
                }
                return responseData.data.result[0];
            }
        })

        Program.Dao.cfgName = $.extend({}, EpgWeb.Dao.cfgName,{
            from: "library",
            targetName: "entity",
            puyuData: "puyuData",
            live_temp_other:"live_temp_other",
            category_use:"category_use",
            fatherId: 0,
            id: 0,
            editPic: true,
            categoryArr: null,
            getChannel: "getChannel",
            getLegoChannel: "getLegoChannel",
            liveProgramType: "liveProgramType",
            episodeGradeType: "episodeGradeType",
            getLegoCategory: "getLegoCategory"
        });
    }
);